/*
	

*/
public without sharing class AT_Utils
{
	/*
	*/
	public static String parseURL(String inVal)
	{
		String retVal = '';
		if(inVal == null || inVal=='') return '';
		
		integer startIndCut = inVal.indexOf('p=');
		integer iValLength = inVal.length();
		if(startIndCut!=-1)
		{
			if(iValLength>startIndCut+2)
			{
				integer endIndCut = inVal.indexOf('&',startIndCut+2);
				if(endIndCut!=-1)
				{
					retVal = inVal.substring(startIndCut+2,endIndCut);
				}
				else retVal = inVal.substring(startIndCut+2,iValLength);
			}
			else retVal = '';
			
		}
		else retVal = inVal;
		
		return retVal;
	}
	
	public static String htmlSpecialChars(String inVal)
    {
    	if(inVal==null || inVal=='') return inVal;
    	return inVal.replace('&','&amp;').replace('"','&quot;').replace('\'','&#039;').replace('<','&lt;').replace('>','&gt;');
    }
	

}